package com.ruoyi.user.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.support.Convert;
import com.ruoyi.user.domain.SleepDetail;
import com.ruoyi.user.mapper.SleepDetailMapper;

/**
 * 睡眠详细 服务层实现
 * 
 * @author ruoyi
 * @date 2019-02-19
 */
@Service
public class SleepDetailServiceImpl implements ISleepDetailService 
{
	@Autowired
	private SleepDetailMapper sleepDetailMapper;

	/**
     * 查询睡眠详细信息
     * 
     * @param id 睡眠详细ID
     * @return 睡眠详细信息
     */
    @Override
	public SleepDetail selectSleepDetailById(Integer id)
	{
	    return sleepDetailMapper.selectSleepDetailById(id);
	}
	
	/**
     * 查询睡眠详细列表
     * 
     * @param sleepDetail 睡眠详细信息
     * @return 睡眠详细集合
     */
	@Override
	public List<SleepDetail> selectSleepDetailList(SleepDetail sleepDetail)
	{
	    return sleepDetailMapper.selectSleepDetailList(sleepDetail);
	}
	
    /**
     * 新增睡眠详细
     * 
     * @param sleepDetail 睡眠详细信息
     * @return 结果
     */
	@Override
	public int insertSleepDetail(SleepDetail sleepDetail)
	{
	    return sleepDetailMapper.insertSleepDetail(sleepDetail);
	}
	
	/**
     * 修改睡眠详细
     * 
     * @param sleepDetail 睡眠详细信息
     * @return 结果
     */
	@Override
	public int updateSleepDetail(SleepDetail sleepDetail)
	{
	    return sleepDetailMapper.updateSleepDetail(sleepDetail);
	}

	/**
     * 删除睡眠详细对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteSleepDetailByIds(String ids)
	{
		return sleepDetailMapper.deleteSleepDetailByIds(Convert.toStrArray(ids));
	}
	
}
